package SortAlgorithm;

import java.util.Arrays;

public class InsertSort {
    public static void main(String[] args) {
        int[] a = new int[]{3, 4, 5, 6, 7, 8, 9, 10, 2, 3, 4};
        for (int i = 1; i < a.length; i++) {
            int tmp = a[i];
            int j=i-1;
            while(j>-1&&a[j]<tmp){
                a[j+1]=a[j];
                j--;
            }
            a[j+1]=tmp;
        }
        System.out.println(Arrays.toString(a));
    }
        }
